<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="admin_menu.jsp"%>
<!--/sidebar-->
<div class="main-wrap">

	<div class="crumb-wrap">
		<div class="crumb-list">
			<i class="icon-font"></i><a href="admin_index.jsp">首页</a><span
				class="crumb-step">&gt;</span><span class="crumb-name">分类管理</span>
		</div>
	</div>
	<div class="result-wrap">
		<form name="myform" id="myform" method="post" action="admin_douserdel">
			<div class="result-title">
				<div class="result-list">
					<a href="admin_tocateadd"><i class="icon-font"></i>新增分类</a> 
				</div>
			</div>
			<div class="result-content">
				<table class="result-tab" width="100%">
					<tr>
						<th>ID</th>
						<th>分类名称</th>
						<th>操作</th>
					</tr>
					<c:forEach var="cate" items="${catearr}">
						<c:if test="${cate.category_parent == 0}">
							<tr>
								<td>${cate.category_id}</td>
								<td>${cate.category_name}</td>
								<td><a href="admin_tocateupdate?id=${cate.category_id}">修改</a>
									<a href="javascript:del(${cate.category_id})">删除</a></td>
							</tr>
							<c:forEach var="subcate" items="${catearr}">
								<c:if test="${subcate.category_parent == cate.category_id}">
									<tr>
										<td>${subcate.category_id}</td>
										<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${subcate.category_name}</td>
										<td><a
											href="admin_tocateupdate?id=${subcate.category_id}">修改</a> <a
											href="javascript:del(${subcate.category_id})">删除</a></td>
									</tr>
								</c:if>
							</c:forEach>
						</c:if>
					</c:forEach>

					<script>
						function del(id) {
							if (confirm("确定删除此分类吗?")) {
								location.href = "admin_docatedel?id=" + id;
							}
						}
					</script>
				</table>
				<div class="list-page"></div>
			</div>
		</form>
	</div>
</div>
</div>
</body>
</html>